<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>jq</title>
	<script src="jquery.js"></script>
	
</head>
<style>
	
</style>


<body>

	<div>
		<h1>0001</h1>
		<h1>0001</h1>
	</div>
	<div>
		<p>22222</p>
		<p>22222</p>
	</div>
</body>
<script>
	$('div:has(h1)').css({'color':'#f00'}); //作用于div  //找到有h1的div
	
</script>
</html>